package com.bestcem.xm.user.grpc.client.convert;

import com.bestcem.xm.user.grpc.client.dto.GetWxAuthViewDTO;
import com.bestcem.xm.user.grpc.client.dto.UserWxDataCacheDTO;
import com.bestcem.xm.user.grpc.client.dto.WxMiniUserMobileDTO;
import com.bestcem.xm.wechat.grpc.v1.services.GetUserPhoneV2Response;
import com.bestcem.xm.wechat.grpc.v1.services.GetWxAuthViewResponse;
import com.bestcem.xm.wechat.grpc.v1.services.GetWxCacheDataBySessionIdResponse;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueCheckStrategy;

/**
 * wechat转换类
 *
 * @author Linked <zhijian.lin@idiaoyan.com>
 * @version v1.0
 * @date 2022/6/14 19:09
 */
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface UserWechatGrpcConvert {

    @Mapping(target = "phone", source = "mobile")
    UserWxDataCacheDTO response2UserWxDataCacheDTO(GetWxCacheDataBySessionIdResponse response);

    GetWxAuthViewDTO response2GetWxAuthViewDTO(GetWxAuthViewResponse response);

    WxMiniUserMobileDTO response2WxMiniUserMobileDTO(GetUserPhoneV2Response response);
}
